const ConfigEnv = process.env.REACT_APP_ENV

const EnvName = {
  DEV: 'dev',
  PROD: 'prod',
}

export const BrowserEnv = {
  INNER: 'INNER',
  OUTSIDE: 'OUTSIDE',
}

export const ENV = (() => {
  if (ConfigEnv) return ConfigEnv
  const { hostname, port } = window.location
  return hostname.indexOf('yfxn') >= 0 || port ? EnvName.DEV : EnvName.PROD
})()

export const APPCONFIG = {
  NAME: 'Tiya',
  LOGO: 'https://fepublicty.tiyalive.com/tiya/tiya_logo_new.png',
  CDN: 'https://fepublicty.tiyalive.com',
  DOWNLOAD: {
    IOS: 'https://go.onelink.me/fVFP?pid=share',
    ANDROID: 'https://go.onelink.me/fVFP?pid=share',
  },
  OPENAPP: 'tiyaapp://sharecallback?action=',
}

export const ONE_LINK = '//tiya.onelink.me/Q4Ny/93654e89'

export const TIYA_SHARE_SCHEME = 'tiyaapp://sharecallback?action='

export const ShareUrl = {
  [BrowserEnv.INNER]: {
    [EnvName.DEV]: 'http://tiyalive.yfxn.lizhi.fm/static/halloween_2021/index.html',
    [EnvName.PROD]: 'https://www.tiyalive.com/halloween_2021/index.html',
  },
  [BrowserEnv.OUTSIDE]: {
    [EnvName.DEV]: 'http://tiyalive.yfxn.lizhi.fm/static/sharePages/halloween2021.html',
    [EnvName.PROD]: 'http://www.tiyalive.com/sharePages/halloween2021.html',
  },
}

export const LANG = 'en'

export const APP_VERSION = '4.14.0'
